package com.example.knowman.ObService.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.knowman.ObService.OBDigitalArchMainService;
import com.example.knowman.ObService.OBknowLabelMainService;
import com.example.knowman.entity.digitalArchMain;
import com.example.knowman.entity.knowMain;
import com.example.knowman.mapper.DigitalArchMainMapper;
import com.example.knowman.mapper.KnowLabelMainMapper;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

@Service
public class ObDigitalArchMainServiceImpl extends ServiceImpl<DigitalArchMainMapper, digitalArchMain> implements OBDigitalArchMainService {


    @Override
    public Map<Integer, digitalArchMain> getMapTitleLike(String archTitle) {
        return this.lambdaQuery().select()
                .like(archTitle != null && !archTitle.isEmpty(), digitalArchMain::getArchTitle,archTitle).list()
                .stream()
                .collect(Collectors.toMap(digitalArchMain::getArchMainId, Function.identity()));
    }
}
